package com.treasure.mall.biz.entity.contact;

import com.treasure.mall.biz.entity.BasePO;
import com.treasure.mall.biz.entity.user.UserPO;
import com.treasure.mall.zbq.common.ienum.chat.ChatEnums;
import lombok.Data;

import javax.persistence.*;

/**
 * 
 * 直播消息
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.entity.live
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/6/23 13:35
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * Copyright 2019-2022 com.treasure.mall.biz.entity.live Inc. All rights reserved.
 */
@Entity
@Data
@Table(name = "zb_contact_history_message")
public class ContactHistoryMessagePO extends BasePO {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 消息发送目标用户
     */
    @ManyToOne
    @JoinColumn(name = "rel_user_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    protected UserPO userPO;

    /**
     * 群组ID
     */
    @Column(name = "group_id", length = 50)
    private String groupId;


    /**
     * 所属客服商户ID
     */
    @Column(name = "merchant_id")
    private Long merchantId;


    /**
     * 回话类型
     * {@link com.treasure.mall.zbq.common.ienum.chat.ChatEnums.ChatType}
     */
    @Column(name = "chat_type")
    private ChatEnums.ChatType chatType;

    /**
     * 消息内容
     */
    @Column(name = "message_body", columnDefinition = "longtext")
    private String messageBody;
}
